#ifndef InclusionGuard_SoundPotSound_h
#define InclusionGuard_SoundPotSound_h

#include <string>
#include "SoundPotInstrument.h"
#include "SoundPotUtilities.h"

struct VstEvents;


namespace SoundPot
{

	class Instrument;

	class Sound
	{


	public:
		

		/// Sets the sound's type.

		void setType(const SoundPot::InstrumentType& value);

		/// Returns the sound's type.
		const SoundPot::InstrumentType getType() const;

		/// Returns the instrument ID of the instrument the sound is written for.
		const std::string& getInstrumentID() const;
		
		/// Sets the instrument ID of the instrument the sound is written for.
		/**
			Usually called by the factory.
		*/
		void setInstrumentID(const std::string& value);

		/// Controls the sound using Midi.
		/** Usually called by the client.
		*/
		void control(VstEvents* events);

		/// Shows the assigned instrument's editor.
		void showEditor();

		/// Assigns an instrument to the sound.
		/** Usually called by the Host.
		*/
		void assignInstrument(Instrument* instrument);

		/// Returns whether the sound has an instrument assigned.
		bool isAssigned() const;

		/// Returns the assigned instrument.
		Instrument* getAssignedInstrument();

		/// Loads the sound into the assigned instrument.	
		void load();


		
	private:
		
		InstrumentType type;

		std::string instrumentID;

		Instrument* assignedInstrument;

	};
}


#endif